FNR==1{aniso=$4;dwperp=$5}
FNR>1{
  wt=$5; if(aniso>0){wt=$7}; if(dwperp>1){wt=$9};
  dw[$2]+=$wt*$3;
  if(aniso>0){dwa[$2]+=$wt*$5};
  tw[$2]+=$wt;
}
END{
  print "Mean DW factors B_deca:";
  for(ch in dw){print ch,dw[ch]/tw[ch]};
  print "Mean DW factors B_vert:";
  for(ch in dwa){print ch,dwa[ch]/tw[ch]};
}
